/* eslint-disable spaced-comment */
/* eslint-disable eqeqeq */
/* eslint-disable comma-dangle */
/* eslint-disable quotes */
/* eslint-disable semi */

import request from '@/utils/request'

//获取一级分类  /admin/product/getCategory1 GET
export const reqCategory1List = () => {
  return request({
    method: 'GET', url: '/admin/product/getCategory1'
  })
}

//获取二级分类 /admin/product/getCategory2/{category1Id} GET
export const reqCategory2List = (category1Id) => {
  return request({
    method: 'GET', url: `/admin/product/getCategory2/${category1Id}`
  })
}

//获取三级分类 /admin/product/getCategory3/{category2Id} GET
export const reqCategory3List = (category2Id) => {
  return request({
    method: 'GET', url: `/admin/product/getCategory3/${category2Id}`
  })
}

//获取平台属性 /admin/product/attrInfoList/{category1Id}/{category2Id}/{category3Id} GET
export const reqAttrList = (category1Id, category2Id, category3Id) => {
  return request({
    method: 'GET', url: `/admin/product/attrInfoList/${category1Id}/${category2Id}/${category3Id}`
  })
}

//添加属性与属性值 /admin/product/saveAttrInfo POST
export const reqAddOrUpdateAttr = (data) => {
  return request({
    method: 'POST', url: '/admin/product/saveAttrInfo', data
  })
}
